package Polymorphism;

import java.util.ArrayList;

public class Lecturer {
	
	private String name;
	private ArrayList<Student> teaches = new ArrayList<Student>();
	
	public Lecturer(String name) {
		this.name = name;
	}
	
	public void addStudent(Student student) {
		teaches.add(student);
	}
	
	public void printName() {
		System.out.println("Lecture: " + name);
	}
	
	public void printStudents() {
		System.out.println(this.name + " teaches: ");
		for (Student s : teaches) {
			s.printStudent();
		}
	}
}
